﻿using System;
using System.XML;

namespace MythtvGadget
{
    /*
     <Program programFlags="0" title="Last Choir Standing" programId="" catType="series" category="Entertainment" seriesId="128880423" endTime="2008-08-30T19:05:00" lastModified="2008-08-30T18:43:04" subTitle="" stars="1" repeat="0" fileSize="0" startTime="2008-08-30T18:00:00" hostname="quad">
It's the final: three groups battle for the glory of being crowned the Last Choir Standing (and glory is all they get - they don't win a recording contract or a West End show or anything). The clean-cut boys of Only Men Aloud! should get the granny vote despite resembling possessed waxworks. But they're up against plucky youngsters Ysgol Glaneathwy, who last week had Russell Watson all a-tremble as he saved them from elimination at the expense of the fancied ACM Gospel Choir. Or could Revelation, surprise semi-final survivors, steal it? The choice is yours! RT reviewer - Jack Seale The results show is on at 8:50pm on BBC1.
<Channel chanFilters="" channelName="BBC 1 London" chanNum="1" sourceId="1" commFree="0" inputId="13" chanId="7301" callSign="BBC1"/>
<Recording dupInType="15" dupMethod="6" recGroup="Default" encoderId="13" recEndTs="2008-08-30T19:05:00" recStatus="-2" recordId="992" recProfile="Default" recType="1" playGroup="Default" recPriority="1" recStartTs="2008-08-30T18:43:00"/>
</Program>
    */
    public class Program
    {
        public string Title;
        public string SubTitle = String.Empty;
        public string Description;
        public string ChannelCallSign;
        public DateTime StartTime;
        public DateTime EndTime;

        public Program(XMLNode nod)
        {
            try
            {
                XMLNode tempNod;

                Title = nod.Attributes.GetNamedItem("title").Text;

                tempNod = nod.Attributes.GetNamedItem("subTitle");
                if (tempNod != null)
                    SubTitle = tempNod.Text;

                Description = nod.Text;

                tempNod = nod.SelectSingleNode("Channel");
                ChannelCallSign = tempNod.Attributes.GetNamedItem("callSign").Text;

                StartTime = Utilities.XMLDateTimeParser(nod.Attributes.GetNamedItem("startTime").Text);
                EndTime = Utilities.XMLDateTimeParser(nod.Attributes.GetNamedItem("endTime").Text);
            }
            catch (Exception)
            {
            }
        }
    }
}
